import os


def main():
    the_dir = r"D:\ISPTest\HelpTest\WuRuoQiGraduate\ShaneBackend\src\main\java\com\baizhi\shane\shane\entity"
    file_list = os.listdir(the_dir)
    for file in file_list:
        print(file)
        file_dir = the_dir + "\\" + file
        with open( file_dir,"r", encoding="utf-8") as  r_file:
            file_text = r_file.read()
        if ("@TableField(fill = FieldFill.INSERT)" not in file_text):
            print(file_text)
            file_text.replace("private Date createTime;","@TableField(fill = FieldFill.INSERT)\nprivate Date createTime;")
        with open( file_dir,"w", encoding="utf-8") as  w_file:
            w_file.write(file_text)
        break
if __name__ == "__main__" :
    main()